/*
 * Copyright 2025 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
 */

package dev.icerock.moko.resources
import dev.icerock.moko.resources.utils.OhosResourceUtils
import kotlin.toUInt

actual class PluralsResource(val resourceName: String) {

    internal fun getString(number: UInt): String? {
        return OhosResourceUtils.getPlural(resourceName, number)?:throw Exception()
    }

    internal fun getFormatString(number: UInt, list: List<Any>): String? {
        return OhosResourceUtils.getPlural(resourceName, number, list)?:throw Exception()
    }

    fun test(number: UInt) {
        val testRes = getString(number)
        println("test PluralsResource: $testRes")
    }

    fun testFormat() {
        val list: List<Any> = listOf(
            18,
            "xiaowang",
            0.221,
            "xiaoli",
            10086
        )
        val testRes = getFormatString(2u, list)
        println("test StringFormatResource: $testRes")
    }
}